home *** CD-ROM | disk | FTP | other *** search
- /* 1. KEYWORDS -----------------------------------------------------------
-
- Defined by AmigaOS are: IMPORT, UBYTE, UWORD, ULONG.
-
- AGLOBAL is considered obsolete; use of EXPORT is preferred. */
-
- #define AUTO auto /* automatic (function-scope) */
- #define AGLOBAL /* global (project-scope) */
- #define EXPORT /* global (project-scope) */
- #define MODULE static /* external static (file-scope) */
- #define PERSIST static /* internal static (function-scope) */
- typedef signed char FLAG; /* 8-bit signed quantity (replaces BOOL) */
- typedef signed char SBYTE; /* 8-bit signed quantity (replaces Amiga BYTE) */
- typedef signed short SWORD; /* 16-bit signed quantity (replaces Amiga WORD) */
- typedef signed long SLONG; /* 32-bit signed quantity (same as LONG) */
- #define elif else if
-
- // 2. DEFINES ------------------------------------------------------------
-
- #define LEFTSIDE 0
- #define RIGHTSIDE 1
- #define MAXLINES 47
-
- #define NONE 0
- #define HUMAN 1
- #define AMIGA 2
-
- #define AMSIR 0
- #define EON 1
- #define GEOFU 2
- #define ING 3
- #define OGAL 4
- #define SYGIL 5
-
- #define LAND 0
- #define SEA 1
- #define ISLE 2
- #define PENINSULA 3
-
- #define BALMUNG 0
- #define DRAGVENDILL 1
- #define GRAM 2
- #define HRUNTING 3
- #define LOVI 4
- #define TYRFING 5
-
- #define TURNS 20
-
- #define RUNES 5
-
- #define BROSUNGNECKLACE 0
- #define FREYFAXI 1
- #define MAGICSHIRT 2
- #define MAILCOAT 3
- #define HEALINGPOTION 4
- #define TELEPORTSCROLL 5
-
- #define BEOWULF 0
- #define BRUNHILD 1
- #define EGIL 2
- #define RAGNAR 3
- #define SIEGFRIED 4
- #define STARKAD 5
-
- #define MULTIKEYBOARD 0
- #define COUNTRY 1
- #define COUNTER 2
- #define ANYKEY 3
- #define YNKEYBOARD 4
- #define GLKEYBOARD 5
- #define WRKEYBOARD 6
-
- #define ONEKEY_YES 0
- #define ONEKEY_NO 1
- #define ONEKEY_WITHDRAW 2
- #define ONEKEY_RESTART 3
- #define ONEKEY_TRANSFER 4
- #define ONEKEY_GLORY 5
- #define ONEKEY_LUCK 6
- #define ONEKEYS ONEKEY_LUCK
-
- #define FREY 0
- #define LOKI 1
- #define NJORD 2
- #define ODIN 3
- #define THOR 4
- #define TYR 5
-
- #define UPPER 0
- #define LOWER 1
-
- #define COUNTERWIDTH 2 // in words (24 pixels, rounded up)
- #define COUNTERHEIGHT 24 // in pixels
- #define DEPTH 7 // in bitplanes
- #define CONNECTIONS 7
- #define TBSIZE 11
-
- // double buffering subsystem
- #define OK_REDRAW 1
- #define OK_SWAPIN 2
-
- // types of things
- #define HERO 0
- #define JARL 1
- #define MONSTER 2
- #define TREASURE 3
- #define SORD 4
- #define KINGDOM 5
-
- // quantities of things, counting from 0
- #define HEROES 5
- #define JARLS 17
- // @@: #define MONSTERS 26
- #define MONSTERS 30
- #define SORDS 5
- // @@: #define TREASURES 3
- #define TREASURES 5
-
- #define FACEUP 0
- #define FACEDOWN 1
-
- #define SCREENXPIXEL 640
- #define SCREENYPIXEL 512
- #define ABOUTXPIXEL 312
- #define ABOUTYPIXEL 76
-
- #define SLOTS (HEROES + 1 + JARLS + 1 + MONSTERS + 1 + TREASURES + 1 + SORDS + 1 - 1)
- #define ATTACKS (HEROES + 1 + JARLS + 1 + MONSTERS + 1 + 36)
-
- // 3. GLOBAL FUNCTIONS ---------------------------------------------------
-
- // from system.c
- AGLOBAL void cleanexit(SLONG rc);
- AGLOBAL void screenoff(void);
- AGLOBAL void screenon(void);
- AGLOBAL void darken(void);
- AGLOBAL void say(SLONG position);
- AGLOBAL void hint(STRPTR thehint1, STRPTR thehint2);
- AGLOBAL SLONG getevent(SLONG mode, SLONG* countertype);
-
- // from map1.c
- AGLOBAL void drawmap(void);
-
- // from map2.c
- AGLOBAL void drawmap2(void);
-
- // from gfx.c
- AGLOBAL void drawabout(void);
- AGLOBAL void drawlogo(void);
- AGLOBAL void boingball(void);
- AGLOBAL void unboingball(void);
- AGLOBAL void preboingball(void);
- AGLOBAL void DrawGels(void);
- AGLOBAL WORD bounceORoutine(struct AnimOb *anOb);
- /* This is an oroutine so parameters are fixed;
- it needs global exposure as it is called directly by AmigaDOS. */
-
- // from engine.c
- AGLOBAL void place_monsters(void);
- AGLOBAL void showcountry(SLONG country);
- AGLOBAL void withdraw(SLONG whichhero);
- AGLOBAL void phase1(void);
- AGLOBAL void phase2(void);
- AGLOBAL void phase3(void);
- AGLOBAL void saywho(SLONG countertype, SLONG counter, FLAG comma, FLAG lowercase);
- AGLOBAL void place_jarls(void);
- AGLOBAL void print_paralyzed(SLONG paralyzed_value, SLONG index);
- AGLOBAL void print_location(SLONG whichcountry, SLONG index);
- AGLOBAL void print_sea(SLONG sea_value, SLONG index);
- AGLOBAL void print_hagall(SLONG hagall_value, SLONG index);
- AGLOBAL void print_routed(SLONG routed_value, SLONG index);
- AGLOBAL void promote(SLONG whichhero, SLONG whichjarl);
- AGLOBAL SLONG getusualmoves(SLONG countertype, SLONG whichcounter);
- AGLOBAL void faxi_disappear(void);
- AGLOBAL void pad(STRPTR thestring);
- AGLOBAL SLONG getstrength(SLONG countertype, SLONG counter, FLAG defending);
- AGLOBAL void newhero(SLONG whichhero, FLAG givesord);
- AGLOBAL void anykey(void);
- AGLOBAL void treasure_disappear(SLONG whichtreasure);
-
- // from counters.c
- AGLOBAL void init_counters(void);
- AGLOBAL void move_hero(SLONG whichhero, FLAG display);
- AGLOBAL void move_jarl(SLONG whichjarl, FLAG display);
- AGLOBAL void move_monster(SLONG whichmonster, FLAG display);
- AGLOBAL void move_treasure(SLONG whichtreasure, FLAG display);
- AGLOBAL void move_sord(SLONG whichsord, FLAG display);
- AGLOBAL void createcounters(void);
- AGLOBAL void destroycounters(void);
- AGLOBAL void revealjarl(SLONG whichjarl, FLAG display);
- AGLOBAL void hidejarl(SLONG whichjarl, FLAG display);
- AGLOBAL void unslot_hero(SLONG whichhero);
- AGLOBAL void unslot_jarl(SLONG whichjarl);
- AGLOBAL void unslot_monster(SLONG whichmonster);
- AGLOBAL void unslot_treasure(SLONG whichtreasure);
- AGLOBAL void unslot_sord(SLONG whichsord);
- AGLOBAL SLONG checkcounters(SWORD mousex, SWORD mousey, SLONG* countertype);
- AGLOBAL void select_hero(SLONG whichhero, FLAG display);
- AGLOBAL void deselect_hero(SLONG whichhero, FLAG display);
- AGLOBAL void select_jarl(SLONG whichjarl, FLAG display);
- AGLOBAL void deselect_jarl(SLONG whichjarl, FLAG display);
- AGLOBAL void select_monster(SLONG whichmonster, FLAG display);
- AGLOBAL void deselect_monster(SLONG whichmonster, FLAG display);
- AGLOBAL void remove_hero(SLONG whichhero, FLAG display);
- AGLOBAL void remove_jarl(SLONG whichjarl, FLAG display);
- AGLOBAL void remove_monster(SLONG whichmonster, FLAG display);
- AGLOBAL void remove_treasure(SLONG whichtreasure, FLAG display);
- AGLOBAL void remove_sord(SLONG whichsord, FLAG display);
- AGLOBAL void refreshcounters(void);
- AGLOBAL void reset_images(void);
- AGLOBAL void hero_to_jarl(SLONG whichhero, SLONG whichjarl);
- AGLOBAL void info(SLONG countertype, SLONG counter);
- AGLOBAL void doc(SLONG number);
-
- // 4. GLOBAL STRUCTURES --------------------------------------------------
-
- AGLOBAL struct WorldStruct
- { // initialized
-
- SLONG centrex, centrey, tax, type;
- STRPTR name;
- SLONG connection[CONNECTIONS + 1];
-
- // uninitialized
- SLONG hero;
- FLAG is, slot[SLOTS + 1], visited;
- };
- AGLOBAL struct RuneStruct
- { STRPTR name, desc;
- };
- AGLOBAL struct HeroStruct
- { // all uninitialized
-
- STRPTR name;
- SLONG strength, moves, glory, luck, control, sword, where, homewhere,
- wealth, slot, promoted, rune, god, sea, maidens;
- FLAG alive, verydead, wounded, foundbob, moved, loseturn, hagall,
- routed, attacking, defending;
- SLONG attacked[ATTACKS + 1], attacktype[ATTACKS + 1];
- };
- AGLOBAL struct JarlStruct
- { // initialized
- SLONG strength,
- moves;
- STRPTR name;
-
- // uninitialized
- FLAG taken, alive, foundbob, recruitable, loseturn, hagall, routed,
- attacking, defending;
- SLONG where, homewhere, wealth, face, hero, slot, sea,
- attacked[ATTACKS + 1], attacktype[ATTACKS + 1];
- };
- AGLOBAL struct MonsterStruct
- { // initialized
- SLONG species, strength, moves;
- STRPTR name;
-
- // uninitialized
- FLAG taken, alive, foundbob, hagall;
- SLONG where, slot, wealth, sea;
- };
- AGLOBAL struct TreasureStruct
- { // initialized
- STRPTR name;
- SWORD y;
-
- // uninitialized
- SLONG possessor, possessortype;
- FLAG taken, foundbob;
- SLONG where, slot;
- };
- AGLOBAL struct SordStruct
- { // initialized
- STRPTR name;
- SWORD y;
-
- // uninitialized
- SLONG possessor, possessortype;
- FLAG taken, foundbob;
- SLONG where, slot;
- };
-